home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8879 < prev    next >
Encoding:
Text File  |  1996-08-05  |  955 b   |  40 lines

  1. Path: newshub.ccs.yorku.ca!news
  2. From: KuMan <" yu133496"@yorku.ca>
  3. Newsgroups: comp.lang.c++
  4. Subject: extern functions questions????????
  5. Date: Mon, 26 Feb 1996 22:39:36 -0500
  6. Organization: York University, Ontario, Canada
  7. Message-ID: <4gtug0$j3t@sunburst.ccs.yorku.ca>
  8. NNTP-Posting-Host: george10.slip.yorku.ca
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win95; I)
  13.  
  14. I've this problem that I have to declare a class member function with two parameters(one 
  15. is a char pointer, the other is an int index). O.K. the problem is that the int index is also the 
  16. array index for that particular class.......
  17.  
  18. class whatever{
  19.     .    
  20.     .
  21.     add(int index, char *things);    // member function.
  22.     .
  23.     .
  24. }
  25.  
  26. main(){
  27.     .
  28.     whatever x[20];        
  29.     .
  30.     .
  31.     x.add[index](index, "hello");    //array index(main) is the 
  32.                     //same member function index(add).
  33.     .
  34.     .
  35. }
  36.     
  37. what can I do to make this function work??
  38.  
  39. thank you
  40.